$(function () {
    $("#page").load("/back/page.html");
    findAll();
})
function findAll() {
    let da={
        pageNum:$.trim($("#pageNum").val()),//页数
        pageSize:$.trim($("#pageSize").val()),//条数
        name:$.trim($("#name").val()),
        phone:$.trim($("#phone").val()),
        mailbox:$.trim($("#mailbox").val()),
        project:$.trim($("#project").val()),
        message:$.trim($("#message").val()),
        startdate:$("#startdate").val(),
        enddate:$("#enddate").val(),
        feedback:$.trim($("#feedback").val()),
        ordbydate:$("#ordbydate").val(),
    };
    let data=myAjax("/back/message/findAll",da,"get");
    $("#pageCount").html(data.number);
    data=data.list;
    let html='';
    for (let i=0;i<data.length;i++){
        let feedback=data[i].feedback == undefined ? "" : data[i].feedback;

        html +='   <tr>\n' +//字符串拼接
            '            <td>'+data[i].id+'</td>\n' +
            '            <td>'+data[i].name+'</td>\n' +
            '            <td>'+data[i].phone+'</td>\n' +
            '            <td>'+data[i].mailbox+'</td>\n' +
            '            <td>'+data[i].project+'</td>\n' +
            '            <td><div class="biaos">'+data[i].message+'</div></td>\n' +
            '            <td>'+data[i].date+'</td>\n' +
            '            <td><div class="biaos">'+feedback+'</div></td>\n' +
            '            <td><input type="button" value="反馈" onclick="updatabyid('+data[i].id+')"></td>\n' +
            '        </tr>';
    }
    $("#messageFindAll").html(html);//对当前tbody进行赋值
}

function updatabyid(id) {
    localStorage.setItem("messageId",id);
    $('#reght').load('/back/message/messageUpdate.html')
}

